const express = require('express');
const pool = require('../../pool.js');
const customer = express.Router();
// 查询用户评论
customer.get('/comment', (req, res) => {
    pool.query('select * from comments where  oid =?', [req.query.oid], (err, r) => {
        if (err) {
            throw err;
        }
        res.send(r);
    })
});
customer.post('/reply', (req, res) => {
    let reply = req.body.reply;
    pool.query('update comments set shopReply = ? where  oid = ?', [reply, req.body.oid], (err, r) => {
        if (err) {
            throw err;
        }
        res.send(r);
    })
})
module.exports = customer;